<script setup>
import { computed } from 'vue'
defineOptions({
  name: 'SvgIcon',
})

const props = defineProps({
  name: '',
  color: '#000',
  size: '16px',
})
const iconName = computed(() => `#icon-${props.name}`)
</script>

<template>
  <svg
    class="svg-icon"
    aria-hidden="true"
    :style="{ width: size, height: size }"
  >
    <use :xlink:href="iconName" :fill="color" />
  </svg>
</template>

<style scoped lang="scss">
$width: v-bind(size);
$height: v-bind(size);

.svg-icon {
  width: $width;
  height: $height;
  position: relative;
  fill: currentColor;
}
</style>
